package org.example.ch07;

import com.github.pagehelper.PageInfo;
import org.example.ch07.entity.City;
import org.example.ch07.sercive.CityService;

import java.util.List;

/**
 * ClassName: Main
 * Description:
 *
 * @Author zjl
 * @Create 2025/04/25 09:09
 * @Version 1.0
 */
public class Main {

    public static void main(String[] args) {
        CityService service = new CityService();
        //List<City> cities = service.pageCity(0, 10);
        PageInfo<City> pageInfo = service.pageCity2(1, 10);
        System.out.println("当前页：" + pageInfo.getPageNum());
        System.out.println("上一页：" + pageInfo.getPrePage());
        System.out.println("下一页：" + pageInfo.getNextPage());
        System.out.println("总页数：" + pageInfo.getPages());
        System.out.println("总记录数：" + pageInfo.getTotal());
        System.out.println("每页记录数：" + pageInfo.getPageSize());
        pageInfo.getList().forEach(city -> System.out.println(city.getCityName()));


    }
}
